<?php
include_once("model/Model.php");

class Controller {
	public $model;
	
	public function __construct() {  
        $this->model = new Model();

    } 
	
	public function invoke() {
		if (!isset($_GET['game'])) {
			$games = $this->model->getListGame();
			// Online
			$countGameOnline = $this->model->getNumOfGameOnline();
			$listGameOnline = $this->model->getListGameOnline();
			
			// Offline
			$countGameOffline = $this->model->getNumOfGameOffline();
			$listGameOffline = $this->model->getListGameOffline();
			include 'view/listGame.php';
		} else {
			$gameDetail = $this->model->getGame($_GET['game']);
			include 'view/gameDetail.php';
		}
	}
}